package csel.model;

import junit.framework.TestCase;
import org.junit.Test;

import csel.model.entity.Summoner;
import csel.model.entity.Sneak;

public class TestGameFactory extends TestCase
{
	Model m;
	
	public void setUp()
	{
		m = new Model();
	}
	
	public void testNewGame() throws java.io.IOException
	{
		GameFactory.makeNewGame(new Summoner(), "LOL WHAT UP", m);
	}
	
	public void testSave() throws java.io.IOException
	{
		GameFactory.makeNewGame(new Summoner(), "LOL WHAT UP", m);
		
		m.save("test.sav");
	}
	
	public void testLoad() throws java.io.IOException
	{
		m.load("test.sav");
	}
	
	public void testLoad2() throws java.io.IOException
	{
		GameFactory.makeNewGame(new Sneak(), "LOL SNEAK", m);
		
		m.load("test.sav");
	}
	
	@Test(expected=java.io.FileNotFoundException.class)
	public void testLoadFail() throws java.io.IOException
	{
		m.load("rofldoesntexist.sav");
	}
}
